home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / NGL2.0.1J(68k).sit / NGL2.0.1J(68k) / Font Sample / Font_Sample.c < prev    next >
C/C++ Source or Header  |  1996-09-19  |  2KB  |  96 lines

  1. /*============================================================
  2.  
  3.                     N_Font サンプルプログラム
  4.                     
  5. ============================================================*/
  6.  
  7. #include        "N_Library.h"
  8.  
  9. void Int_Main_Loop(void);
  10. void Begin_Timer_Int(void* Int_Routine,short Tm_Counter);
  11. void Stop_Timer_Int(void);
  12.  
  13. short        Data_Rsrc = 0;
  14. WindowPtr    window;
  15.  
  16. //表示する数字
  17. short        x = 640;
  18. char            mes[] = "WELCOME TO N GAME LIBRARY!  THANK YOU FOR DOWNLOADING/ THIS IS A FONT SAMPLE/@";
  19. Str255        putmes = "¥pN";
  20. short        mes_count = 0;
  21. short        dot_count = 14;
  22. short        style = 0;
  23.  
  24. void main(void)
  25. {
  26.     ToolboxInit();
  27.     ColorCheck();                                                            //画面モードチェック&切り替え
  28.     HideMenuBar();
  29.     HideCursor();
  30.     window = GetNewWindow (128,nil,(WindowPtr)-1L );
  31.     SetPort((GrafPtr)window);
  32.     N_Window_Set(window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),640,480);
  33.     Open_Resource_File(128,1,&Data_Rsrc);
  34.     N_Sp_Make(640,16);                                                    //スプライトスクリーン作成
  35.     N_Cel_Make(65536);                                                    //セル用作業バッファ作成
  36.     N_Font_Init();
  37.     N_Sprite_Set(130,11,12,16,1,13,4,0);
  38.  
  39.     N_Font_Set(0,0,0,0x80000000,0);                                            //Font Set 0 重ね合わせ・通常表示
  40.     N_Font_Set(1,0x80000000+11,0,0x80000000+26+11,0x80000000+37+11);        //Font Set 1 
  41.  
  42.     N_Pict_Draw(128,0,0,(GrafPtr)Main_Window,true);                            //背景(PICT 128)をかいておく
  43.     Close_Resource_File(&Data_Rsrc);
  44.     Begin_Timer_Int(Int_Main_Loop,17);                                        //タイマー割り込み START
  45.     do                                                                    //マウスボタンを押せば終了
  46.     {
  47.     }
  48.     while (!Button());
  49.     Stop_Timer_Int();                                                        //タイマー割り込み STOP
  50.     ShowCursor();
  51.     ShowMenuBar();
  52.     ColorRevert();
  53. }
  54.  
  55. void Int_Main_Loop(void)
  56. {
  57.     char        me;        
  58.     Rect        sc_rect;
  59.  
  60.     if (dot_count == 0)
  61.     {
  62.         dot_count = 18;
  63.         me = mes[mes_count];
  64.         if (me == '@')
  65.         {
  66.             me = ' ' ;
  67.             mes_count = 0;
  68.             style++;
  69.             if (style == 2) style = 0;
  70.         }
  71.         else
  72.         {
  73.             *(putmes+1) =  me;
  74.             N_Font_Put(putmes,626,430,14,1,0,30);
  75.             mes_count++;
  76.  
  77.             if (style == 1)
  78.             {
  79.                 SetRect(&sc_rect,622,442,640,430+16);
  80.                 ScrollRect(&sc_rect,-1,0,nil);
  81.                 SetRect(&sc_rect,622,438,640,430+16);
  82.                 ScrollRect(&sc_rect,-1,0,nil);
  83.                 SetRect(&sc_rect,622,434,640,430+16);
  84.                 ScrollRect(&sc_rect,-1,0,nil);
  85.             }
  86.         }
  87.     }
  88.     dot_count--;
  89.     SetRect(&sc_rect,0,430,640,430+16);
  90.     ScrollRect(&sc_rect,-1,0,nil);
  91. }
  92.  
  93.  
  94.  
  95.  
  96.